package com.kly.user.enums;

/**
 * 操作文件类型：1-新增 2-修改 3-删除
 * @author linqu
 */
public enum ImageOpTypeEnum {

    upload(1, "upload file", "上传文件"),
    change(2, "change file", "修改文件"),
    remove(3, "remove file", "删除文件"),
    ;

    private final Integer type;

    private final String Value;

    private final String description;


    ImageOpTypeEnum(Integer type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public Integer getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static ImageOpTypeEnum fromType(Integer type) {
        if (type == null) {
            return null;
        }
        for (ImageOpTypeEnum opTypeEnum : values()) {
            if (opTypeEnum.getType().equals(type)) {
                return opTypeEnum;
            }
        }
        return null;
    }
}
